package com.blog.data;

import java.sql.Connection;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class C3p0Helper {

	private static final ComboPooledDataSource DS = new ComboPooledDataSource();
	
	public static Connection getConnection(){
		try{
			return DS.getConnection();
		}catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e.getMessage());
		}
	}
	
	public static DataSource getDataSource(){
		return DS;
	}
	
}
